package com.apchernykh.rozhlasapp.utils.podcastsaver;

import com.apchernykh.rozhlasapp.utils.PreferencesCache;

import android.content.Context;


public final class RecorderFactory {
	
	
	public static IPodcastSaver getRecorder(Context iContext) {
		final PreferencesCache aPref = new PreferencesCache();
		aPref.refresh(iContext);
		
		String aRecorderType = aPref.mPodcastRecorderName;
		
		if (aRecorderType.equals("BrowserIntegratedRecorder")) {
			return new BrowserIntegratedRecorder();
		} else if (aRecorderType.equals("DownloadersOnlyRecorder")) {
			return new DownloadersOnlyRecorder();
		} else {
			// by default
			return new SilentRecorder();
		}

	}
}
